// 此处第二个参数vm，就是我们在页面使用的this，你可以通过vm获取vuex等操作，更多内容详见uView对拦截器的介绍部分：
// https://uviewui.com/js/http.html#%E4%BD%95%E8%B0%93%E8%AF%B7%E6%B1%82%E6%8B%A6%E6%88%AA%EF%BC%9F
const http = uni.$u.http
// 此处使用了传入的params参数，一切自定义即可
const getApiD = (data = {}, config) => http.get('/frontend/login/wechat', {params: data,...config});
const postApiD = (params = {}, config) => http.post('/frontend/yard/redeemRecord', params, config);

const flashSaleOfGoodsList = (params = {}) => http.post('/frontend/mall/goods/flashSaleOfGoodsList', params);
const homePageSearch = (params = {}) => http.post('/frontend/mall/goods/homePageSearch', params);
// const waresTypeMenu = (params = {}) => http.get('/frontend/mall/goods/type/waresTypeMenu', params);
// const allProductsList = (params = {}) => http.post('/frontend/mall/goods/allProductsList', params);
const getUserInfo = (params = {}) => http.post('/wechat/user/getById', params);
const getGoodsDetail = (params = {}) => http.get('/frontend/mall/goods/getGoodsDetail', params);
const getAddressList = (params = {}) => http.get('/wechat/shipping/address/list', params);
const editAddress = (params = {}) => http.post('/wechat/shipping/address/add', params);
const frontendGoodsRollList = (params = {}) => http.post('/frontend/mall/goods/roll/frontendGoodsRollList', params);
const frontendGoodsRollDetail = (params = {}) => http.get('/frontend/mall/goods/roll/frontendGoodsRollDetail', params);
const writeOff = (params = {}) => http.get('/frontend/mall/goods/roll/writeOff', params);
const scanCode = (params = {}) => http.get('/frontend/mall/goods/roll/scanCode', params);
const getSalesStatistics = (params = {}) => http.post('/frontend/mall/order/businessRollSalesStatistics', params);
const getSalesStatistics1 = (params = {}) => http.post('/frontend/mall/order/platformGoodsSalesStatistics', params);
const getSalesStatistics2 = (params = {}) => http.post('/frontend/mall/order/platformRollSalesStatistics', params);
const businessDrop = (params = {}) => http.get('/frontend/mall/business/businessDropDownMenuByCommunityId', params);
const getAddressInfo = (params = {}) => http.get('/wechat/shipping/address/getShippingAddressInfo', params);
const updateCartNum = (params = {}) => http.post('/frontend/mall/goods/cart/updateCartNum', params);
const delGoods = (params = {}) => http.post('/frontend/mall/goods/cart/delete', params);
const delAddress = (params = {}) => http.get('/wechat/shipping/address/delete', params);
const frontendGoodsCart = (params = {}) => http.post('/frontend/mall/goods/cart/frontendGoodsCart', params);
const confirmOrder = (params = {}) => http.post('/frontend/pay/confirmOrder', params);
const goToPay = (params = {}) => http.post('/frontend/pay/toPay', params);
const frontendOrderList = (params = {}) => http.post('/frontend/mall/order/frontendOrderList', params);
const frontendOrderDetail = (params = {}) => http.get('/frontend/mall/order/frontendOrderDetail', params);
const queryLogisticsDetail = (params = {}) => http.get('/frontend/mall/logistics/getLogisticsInfo', params);
const volunteerStatistics = (params = {}) => http.post('/wechat/volunteer/volunteerStatistics', params);
const confirmTakeOver = (params = {}) => http.get('/frontend/mall/logistics/confirmTakeOver', params);
const continuePayment = (params = {}) => http.post('/frontend/pay/continuePayment', params);
const initiateRefund = (params = {}) => http.post('/frontend/mall/order/refund/initiateRefund', params);
const initiateRefundDetail = (params = {}) => http.get('/frontend/mall/order/refund/initiateRefundDetail', params);
const frontendPlatformOrderList = (params = {}) => http.post('/frontend/mall/order/frontendPlatformOrderList', params);
const revokeRefund = (params = {}) => http.get('/frontend/mall/order/refund/revokeRefund', params);
const updateGoodsStatus = (params = {}) => http.post('/frontend/mall/goods/updateGoodsStatus', params);
const getSkuList = (params = {}) => http.get('/frontend/mall/goods/sku/list', params);
const updateGoodsById = (params = {}) => http.post('/frontend/mall/goods/updateGoodsById', params);
const getConsultation = (params = {}) => http.post('/wechat/news/consultation/list', params);
const getNewsConsultationInfo = (params = {}) => http.get('/wechat/news/consultation/getNewsConsultationInfo', params);
const getServiceList = (params = {}) => http.post('/wechat/service/content/list', params);
const getNotTroopsList = (params = {}) => http.post('/wechat/troops/getNotParticipatingTroopsList', params);
const getCartNum = (params = {}) => http.get('/frontend/mall/goods/cart/getCartNum', params);
const refundOrderList = (params = {}) => http.post('/frontend/mall/order/refund/frontendOrderList', params);
const mallFrontendOrderList = (params = {}) => http.post('/frontend/mall/order/refund/frontendPlatformOrderList', params);
const platformPageSearch = (params = {}) => http.post('/frontend/mall/goods/platformPageSearch', params);
const participatedList = (params = {}) => http.post('/wechat/troops/user/participatedList', params);
const goodsTypeList = (params = {}) => http.get('/frontend/mall/goods/type/goodsTypeList', params);
const getTroops = (params = {}) => http.get('/wechat/troops/getTroopsAssociationActivityList', params);
const addLogistics = (params = {}) => http.post('/frontend/mall/logistics/addLogistics', params);
const logisticsDropDown = (params = {}) => http.get('/frontend/mall/logistics/company/dropDown', params);
const examine = (params = {}) => http.post('/frontend/mall/order/refund/examine', params);
const getBusinessMenuId = (params = {}) => http.get('/frontend/mall/business/businessDropDownMenuByCommunityId', params);
const frontendList = (params = {}) => http.post('/frontend/mall/refund/reason/frontendList', params);
const updateSku = (params = {}) => http.post('/frontend/mall/goods/sku/updateSku', params);
const myGoodsStatistics = (params = {}) => http.get('/wechat/volunteer/myGoodsStatistics', params);

export default {
	getApiD, //get示例接口
	postApiD, //post示例接口
	flashSaleOfGoodsList, //获取秒杀商品
	homePageSearch, //首页商品搜索(热销、近期)
	// waresTypeMenu, //全部商品-分类
	// allProductsList, //全部商品
	getUserInfo, //获取个人中心信息
	// getGoodsDetail, //获取商品详情
	getAddressList, //获取地址列表
	editAddress, //添加-编辑收货地址
	frontendGoodsRollList, //商家券列表
	frontendGoodsRollDetail, //商家券详情
	writeOff, //券核销列表
	scanCode, //扫码核销
	getSalesStatistics, //数据统计-商家端
	getSalesStatistics1, //商品销售统计 数据统计-平台端
	getSalesStatistics2, //商品券销售统计数据统计-平台端
	businessDrop, //商家列表
	getAddressInfo, //获取地址详情
	updateCartNum, //修改购物车数量
	delGoods, //删除商品
	delAddress, //删除地址
	frontendGoodsCart, //购物车列表
	confirmOrder, //购物车去结算 - 立即购买
	goToPay, //去拉起支付
	frontendOrderList, //我的订单
	frontendOrderDetail, //订单详情
	queryLogisticsDetail, //物流信息
	volunteerStatistics, //首页志愿者统计数量
	confirmTakeOver, //确认收货
	continuePayment, //立即支付(待支付)
	initiateRefund, //退款申请
	initiateRefundDetail, //退款详情
	frontendPlatformOrderList, //订单列表-平台
	revokeRefund, //撤销退款
	updateGoodsStatus, //修改商品上下架
	getSkuList, //获取商品id
	updateGoodsById, //编辑商品
	getConsultation, //获取新闻列表
	getNewsConsultationInfo, //获取新闻详情
	getServiceList, //获取服务内容
	getNotTroopsList, //获取用户没有参与过的队伍列表
	getCartNum, //获取购物车数量
	refundOrderList, //售后列表-商家端
	mallFrontendOrderList, //售后列表-平台端
	platformPageSearch, //首页搜索-平台端
	participatedList, //我的队伍-用户端
	goodsTypeList, //获取首页图标
	getTroops, //获取队伍关联活动列表
	addLogistics, //发货
	logisticsDropDown, //物流公司下拉
	examine, //退款审核
	getBusinessMenuId, //首页分类列表
	frontendList, //退款原因下拉
	updateSku, //上传规格
	myGoodsStatistics, //获取个人中心信息数
}
